#!/usr/bin/python

import thread
import time

# Define a function for the thread
def print_time( threadName, delay):
    for i in xrange(20):
        time.sleep(delay)
        print "%s: %s" % ( threadName, time.ctime(time.time()) )

# Create two threads as follows
try:
   thread.start_new_thread( print_time, ("Thread-1", 2, ) )
   thread.start_new_thread( print_time, ("Thread-2", 1, ) )
   thread.start_new_thread( print_time, ("Thread-3", 1, ) )
   
except:
   print "Error: unable to start thread"

while 1:
   pass